package com.zcm.service.weibo.serviceprovider.sina.connect;

/**
 * 
 */

import org.springframework.social.oauth1.AbstractOAuth1ServiceProvider;

import com.zcm.service.weibo.serviceprovider.sina.api.SinaWeibo;
import com.zcm.service.weibo.serviceprovider.sina.api.impl.SinaWeiboTemplate;
/**
 * @author xiongj
 * 
 */
public class SinaWeiboServiceProvider extends AbstractOAuth1ServiceProvider<SinaWeibo> {
	
	public SinaWeiboServiceProvider(String consumerKey, String consumerSecret) {
		super(consumerKey, consumerSecret, new SinaWeiboOAuth1Template(consumerKey,
				consumerSecret, "http://api.t.sina.com.cn/oauth/request_token",
				"http://api.t.sina.com.cn/oauth/authorize",
				"http://api.t.sina.com.cn/oauth/access_token"));
	}

	@Override
	public SinaWeibo getApi(String accessToken, String secret) {
		return new SinaWeiboTemplate(getConsumerKey(), getConsumerSecret(), accessToken, secret);
	}
}
